<template>
  <div>
    <p>个人爱好广泛信息</p>
    <span v-for="(item, index) in arr" :key="index">
      <input type="checkbox" :value="item" v-model="list" />{{ item }}
    </span>
    <ul>
      <li v-for="(item, index) in list" :key="index" v-text="item">
        {{ item }}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      list: [],
    };
  },
  methods: {
    fn(index) {
      console.log(this.arr[index]);

      this.list.push(this.arr[index]);
    },
  },
};
</script>

<style>
div {
  width: 460px;
  height: 300px;
  margin: 100px auto;
  background-color: #8df;
}
p {
  text-align: center;
  padding-top: 20px;
  font-size: 20px;
  color: rebeccapurple;
}
</style>
